#ifndef MATHS_H
#define MATHS_H

#include <QObject>
#include "qpoint.h"
#include "qline.h"
#include "qrect.h"

class Maths : public QObject
{
	Q_OBJECT

public:
	Maths(QObject *parent);
	~Maths();

	static qreal calDistance(QLineF &line);
	static qreal calDistance(QPointF &p1, QPointF &p2);
	static qreal calAngel(QPointF &p1, QPointF &p2);

	static int callAxb(QPointF &p1, QPointF &p2, QPointF & ab);
	static int callCross(QLineF &line1, QLineF &line2, QPointF & cross);
	static QPointF callCross(QRectF &rc, QLineF &line);

	static void moveRectToPoint(QRectF &rc, QPointF &p);
	static QRectF getMargainRect(QRectF &rc, int w,int direction);
	static int judgePointInRectMargain(QRectF &rc, QPointF &p, int w);


private:
	
};

#endif // MATHS_H
